package flc.ast.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;

import org.jetbrains.annotations.NotNull;

import flc.ast.R;
import flc.ast.bean.FormatBean;
import flc.ast.databinding.ItemRvFormatStyleBinding;
import stark.common.basic.adapter.BaseDBRVAdapter;

public class FormatAdapter extends BaseDBRVAdapter<FormatBean, ItemRvFormatStyleBinding> {
    public FormatAdapter() {
        super(R.layout.item_rv_format_style, 0);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemRvFormatStyleBinding> holder, FormatBean item) {
        super.convert(holder, item);
        ItemRvFormatStyleBinding binding = holder.getDataBinding();
        binding.tvName.setText(item.getName());
        if (item.isSelect()) {
            binding.rlAll.setBackgroundColor(Color.parseColor("#F3F3F3"));
            binding.tvName.setTextColor(Color.parseColor("#0C0E12"));
        } else {
            binding.rlAll.setBackgroundColor(Color.parseColor("#FFFFFF"));
            binding.tvName.setTextColor(Color.parseColor("#4D0C0E12"));
        }
    }
}
